package org.alex.sample.service.Impl;


import java.util.Map;

import org.alex.sample.VO.SubjectVOToTest;
import org.alex.sample.VO.UserVO;
import org.alex.sample.dao.StudentDAO;
import org.alex.sample.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements StudentService {
	
	@Autowired
	private StudentDAO stdentDao;

	@Override
	public UserVO findStudentById(Integer userId) throws Exception {
		UserVO userVO = stdentDao.findStudentById(userId);
		return userVO;
	}

	@Override
	public SubjectVOToTest findAllTestBySubjectId(Integer subId) throws Exception {
		return stdentDao.findAllTestBySubjectId(subId);
	}
	
	@Override
	public Map<String, Object> saveExamScore(double score, Integer subId, Integer userId) throws Exception{
		return stdentDao.saveExamScore(score, subId, userId);
	}

}
